home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / GLUT / README.fortran < prev    next >
Text File  |  1996-11-11  |  6KB  |  145 lines

  1. GLUT Fortran users,
  2.  
  3. BUILD INSTRUCTIONS
  4. ===================
  5.  
  6. To build the GLUT Fortran API, do the following:
  7.  
  8.   1)  Make sure you are running IRIX 5.3, 6.1, or 6.2.
  9.  
  10.   2)  Make sure you have Fortran compilers and OpenGL Fortran
  11.       libraries installed (make sure you have the right support
  12.       installed for the "object style" you wish to build).
  13.  
  14.   3)  Run "mkmkfiles.sgi" in this directory.
  15.  
  16.   4)  Make sure you have built the "lib/glut" and "lib/fglut"
  17.       directories:
  18.  
  19.       (cd lib/glut; make)
  20.       (cd lib/fglut; make)
  21.  
  22.   5)  Change to one of the GLUT Fortran library directories,
  23.       depending on what "object style" you wish to build:
  24.  
  25.       O32 (old 32-bit ABI) - "cd lib/fglut"
  26.       N64 (new 64-bit ABI) - "cd lib/fglut.n64"   (IRIX 6.1 & 6.2 only)
  27.       N32 (new 32-bit ABI) - "cd lib/fglut.n32"   (IRIX 6.2 only)
  28.  
  29.       (If you are building a given "object style", make sure you
  30.       build the accompanying GLUT library implementation.  See
  31.       README.irix6)
  32.  
  33.   6)  Execute "make" in the directory.
  34.  
  35. NOTES
  36. ======
  37.  
  38. All GLUT functionality is available through the GLUT Fortran API.
  39.  
  40. A number of example GLUT Fortran examples are built in the directory as
  41. examples of how to write GLUT Fortran programs.
  42.  
  43. There are a number of caveats to using the GLUT Fortran API:
  44.  
  45.   o  The GLUT Fortran API is not built by default.
  46.  
  47.      See the build instructions above.  You will need the IRIX Fortran
  48.      development option installed.
  49.  
  50.   o  The implementation of the GLUT Fortran API is probably only useful
  51.      to IRIX users because the generation of Fortran-to-C wrappers is
  52.      inherently dependent on vendor-dependent calling convention
  53.      dependencies.
  54.  
  55.   o  The IRIX GLUT Fortran API is implemented as a set of wrappers to
  56.      to the GLUT C implementation.  As such, there is a very slight
  57.      overhead to calling OpenGL routine through the GLUT Fortran
  58.      binding (this applies to the OpenGL Fortran wrapper routines as
  59.      well).
  60.  
  61.   o  The ARB's official OpenGL Fortran API prefixes every routine and
  62.      constant with the letter F.  The justification was to avoid name
  63.      space collisions with the C names.  Nearly all modern Fortran
  64.      compilers avoid these name space clashes via other means (underbar
  65.      suffixing of Fortran routines is used by most Unix Fortran
  66.      compilers).
  67.  
  68.      The GLUT Fortran API does _not_ use such prefixing conventions
  69.      because of the documentation and coding confusion introduced by
  70.      such prefixes.  Bending over backwards to support anachronistic
  71.      compliers does not justify this confusion.
  72.  
  73.      While the official OpenGL Fortran API, prefixes both routine and
  74.      constant names, there is no technical justification for prefixing
  75.      constant names.  In practice, it creates a reasonable amount of
  76.      coding and documentation confusion (the confusion is heightened by
  77.      Fortran's default implicit variable initialization so you don't
  78.      realize the lack of a constant prefix until run-time) and pushes
  79.      names one character towards identifier limits.
  80.  
  81.      The GLUT distribution supplies its own version of "GL/fgl.h" and
  82.      "GL/fglu.h" which does not F-prefix constants.  GLUT users are
  83.      encouraged to not use the F-prefixed constants.  (The GLUT
  84.      supplied "GL/fgl.h" also works around problems discussed in the
  85.      next bullet.)
  86.  
  87.      Perhaps the OpenGL ARB will reconsider the F-prefix or (as an
  88.      unfortunate compromise) support both F prefixed and non F prefixed
  89.      constant names.
  90.  
  91.   o  A OpenGL Fortran API implementation was released with IRIX 5.3
  92.      (it was not previously available in IRIX).  While the Fortran
  93.      wrappers work, there are a number of difficulties with using the
  94.      IRIX 5.3 OpenGL Fortran bindings:
  95.  
  96.        +  Make sure you have the "Fortran 77 OpenGL Graphic Library"
  97.       subsystem installed.  Its name is:  ftn_dev.sw.opengl
  98.  
  99.        +  The OpenGL Fortran man pages incorrectly document a number of
  100.       calls taking REAL*4 (real) parameters when they in fact
  101.       require REAL*8 (double precision) parameters.  An example is
  102.       fglviewport.  Any OpenGL (or GLU) routine that takes double's
  103.       as parameters in the C API, takes REAL*8's in the Fortran
  104.       API.  Be very careful to use the dble intrinsic whenever
  105.       passing non-REAL*8 values to such routines!
  106.  
  107.        +  The OpenGL Fortran man pages also do not add the F-prefixes
  108.       to constants discussed in the man pages.  Because GLUT
  109.       supplies a "GL/fgl.h" without F-prefixes, this should be a
  110.       "good thing."
  111.  
  112.        +  The "GL/fgl.h" header file describing the OpenGL Fortran API
  113.       contains identifiers over 32 characters long.  While the MIPS
  114.       Fortran compiler should treat this as a soft warning and
  115.       truncate the identifiers to 32 characters, the compiler
  116.       generates a fatal error.  For this reason, the "GL/fgl.h" in
  117.       this distribution has truncated by hand the "GL/fgl.h"
  118.       identifiers over 32 characters to 32 characters.
  119.  
  120.   o  Because GLUT fonts are compiled into programs and programs
  121.      should only have the fonts compiled into them that they use,
  122.      GLUT font names like GLUT_BITMAP_TIMES_ROMAN_24 are really
  123.      symbols so the linker should only pull in used fonts.
  124.      Unfortunately, if a data symbol is declared EXTERNAL, the
  125.      IRIX Fortran compiler pulls in the symbol whether the symbol
  126.      is used or not.  For this reason, "GL/fglut.h" does not
  127.      explictly declare EXTERNAL the GLUT font symbols.  GLUT
  128.      Fortran programmers should explicitly declare EXTERNAL
  129.      the GLUT fonts they use.
  130.  
  131. INSTALLATION
  132. =============
  133.  
  134. If you want to install the resulting archives into the right system
  135. library directories, do the following:
  136.  
  137.      FOR N32:  cp lib/fglut.n32/libfglut.a /usr/lib32
  138.  
  139.      FOR N64:  cp lib/fglut.n64/libfglut.a /usr/lib64
  140.  
  141. Also, make sure to install the GLUT library implementation versions for
  142. the given object style too.
  143.  
  144. - Mark Kilgard
  145.